package book

import (
	"NovelBook/dao"
	"NovelBook/models/db_models"
	"log"
)

func GetBooks() ([]db_models.Books, error) {
	var books []db_models.Books
	err := dao.GetDb().Find(&books).Error
	if err != nil {
		log.Println("DataBase err : ", err)
		return nil, err
	}
	return books, nil
}
